#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>

int my_strlen1(const char*str)
{
	int count = 0;
	assert(*str);
	while (*str)
	{
		count++;
		str++;
	}
	return count;
}

int my_strlen2(const char* str)
{
	char* p = str;
	assert(*str);
	while (*str)
	{
		str++;
	}
	return str - p;
}

int my_strlen3(const char* str)
{
	if (*str == '\0')
		return 0;
	else
return 1+my_strlen3(str+1);
}


char* my_strcpy(char* des, const char* src)
{
	while (*src != '\0')
	{
	*des = *src;
	des++;
	src++;
	}
	return des;
}


char* my_strcat(char* des, const char* src)
{
	assert(des != NULL);
	assert(src != NULL);
	while (*des)
	{
		des++;
	}
	while (*src)
	{
		*des = *src;
		des++;
		src++;
	}
	return des;
}

int main()
{
	char arr[] = "abcdef";
	char brr[20] = "abc";
	//printf("%d", my_strlen3(arr));
	//my_strcpy(brr, arr);
	//printf("%s",brr );

	my_strcat(brr, arr);
	printf("%s", brr);

	return 0;
}